<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/approveOrder.do"/>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.sales.forms.ApproverOrderForm"%>
<%@ page import="com.scalar.chiptrack.commons.Constants"%>
<%@ page import="com.scalar.chiptrack.users.Functionality" %>
<%@ page import="com.scalar.chiptrack.users.User" %>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR>

<script type="text/javascript">

// Added by Gandhi on 25 Nov 2004
function noenter()
 {
   return !(window.event && window.event.keyCode == 13)

 }


</script>

</HEAD>

<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js">
</script>
<SCRIPT language="JavaScript">

var errors = "";

//Added by veeru on 29th March 2004
var dateElement = "";
function openCalendar(dateValue)
{
    dateElement = dateValue;

    newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
    newWindow.moveTo(550,180);
    newWindow.focus();
}

//Begin: added by Sujan on 19th Nov 2004
    var requestedDt = "";
	function openScheduleCalendar(dateValue, requestedDtValue)
    {
        dateElement = dateValue;
		requestedDt = requestedDtValue;
        newWindow = window.open('<%=chipTracContext%>/jsp/includes/scheduleCalendar.html','scheduleCalendarPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
        newWindow.moveTo(550,180);
        newWindow.focus();
    }
   //End: by sujan


function assignDate(passedValue)
{
    dateElement.value=passedValue;
    window.focus();
}
//Added by Sarada on 10th Oct 2003 to do validations for revisedDate

function dateValidation()
{
	errors = "";
	var dateValue = "";
    var tempDate = document.approverOrderForm["revisedDate"];

	if( typeof tempDate.length == 'undefined' )
    {
		if( chkScheduleRevisedDate(tempDate.value.trim(),"Revised Ship Date","Y") == false)
		{
			errors = errMsg;
			tempDate.select();
			tempDate.focus();
		}
        else if ( isBeforeToday( tempDate.value.trim(),"Revised Ship Date" ) ) // added by sujan on 20th nov 2004 as schedule date can not be before today date
        {
            errors = errMsg;
			tempDate.select();
			tempDate.focus();
        }
	}
	else
	{
		for(var i=0; i< tempDate.length; i++)
		{
			//alert(tempDate[i].value.trim());
			if( chkScheduleRevisedDate(tempDate[i].value.trim(),"Revised Ship Date","Y") == false)
			{
				errors = errMsg;
				tempDate[i].select();
				tempDate[i].focus();
				break ;
			}
            else if ( isBeforeToday( tempDate[i].value.trim(),"Revised Ship Date" ) ) // added by sujan on 20th nov 2004 as schedule date can not be before today date
            {
                errors = errMsg;
			    tempDate[i].select();
			    tempDate[i].focus();
                break;
            }
		}//for

    } //else

    if(errors != '')
		return false;
    else
        return true;
}


    function submitPage(action)
    {

		var errors1 = '';

		if( dateValidation() == false )
		{
            errors1 = errors;
        }

		if(errors1 != '')
        {
            var pa=document.getElementById("errors");
            pa.innerHTML = errors1;
			return;
        }

        document.approverOrderForm.action.value = "ApproveMissedOrder";
		document.approverOrderForm.submit();
    }

// SharatH on July 29, 2003
function showErrorReportPage()
{
    newWindow = window.open ('<%=chipTracContext%>/reportProblem.do','reportProblem','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=750,height=400,resizable=no');
    newWindow.focus();
}

</SCRIPT>

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>

<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigations start -->
<% String heading = ""; %>
<% if((request.getParameter("isSample") != null) && (request.getParameter("isSample").equals("0"))) {
         heading = "Sample Order";
%>
	<%@ include file="/jsp/sales/sample_order_menu.jsp" %>
<% } else {
     heading = "Sales Order";
%>
        <%@ include file="/jsp/sales/sales_order_menu.jsp" %>
<% } %>

</TD>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<html:html>

<!-- from here your body starts -->
<html:form name="approverOrderForm" action="/approveOrder" method="post" type="com.scalar.chiptrack.sales.forms.SalesOrderForm" onsubmit="javascript:submitPage('SUBMIT')">
<!--html:hidden property="salesOrderId" /-->

<center><span class="NArialW"><%=heading%> Details</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>
   <nested:nest property="salesOrder">
   <table border="0" width="90%" align=right>
    <!--This logic:equal is created by Bhaskar on 14 july 2003-->
        <logic:equal name="showMessage" value="TRUE">
            <tr><td colspan=7 align='left'>
            <font class='NArialS'>
            <font color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b>
            </font></td></tr>
        </logic:equal>
     <tr>
       <td width="21%"><font class="NArialL">Sales Order No :</font></td>
       <td width="21%" class="bodytext"><b><nested:write property="salesOrderNo" /></b></td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL">Customer Name :</font></td>
       <td width="21%" class="bodytext"><nested:write property="customerName" /></td>
       <td width="10%">&nbsp;</td>

     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Customer PO No :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="customerPO"/></font></td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL">Contact Person :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="contactPerson"/></font></td>
       <td width="10%">&nbsp;</td>

     </tr>
     <tr>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoRevisionNumber"/> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write  property="poRev"/></font></td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoDate"/> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write  property="poDate"/></font></td>
       <td width="10%">&nbsp;</td>

     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Phone : </font></td>
       <td width="21%" class="bodytext"><nested:write  property="phoneNumber" /></td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL">Cell No :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="cellNumber" /></td>
	   <td width="10%">&nbsp;</td>

     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Fax :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="faxNumber" /></td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL">Email :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="email" /></td>
	   <td width="10%">&nbsp;</td>

     </tr>
	  <tr><!-- Added by Sarada on 8th March 2004  -->
       <td width="21%"><font class="NArialL">Sales Person :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesPerson" /></td>
       <td width="3%">&nbsp;</td>
       <%-- <td width="21%"><font class="NArialL">Sales Person</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesPerson" /></td> --%>
	   <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesRep.Name"/> :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesRep" /></td>
       <td width="10%">&nbsp;</td>

     </tr>
     <tr>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.ShippingMethod" /> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="shippingMethod" /></font></td>
       <td width="3%">&nbsp;</td>
       <%-- td width="21%"><font class="NArialL">Shipping Account :</font></td>
       <td width="21%"><font class="bodytext">< nested:write property="shippingAccount" /></font></td--%>
       <td width="21%"><font class="NArialL">Regional Rep : </font></td>
       <td width="21%" class="bodytext"><nested:write name="salesOrderForm" property="regionalRep" />
       <td width="10%">&nbsp;</td>

     </tr>     
    <tr>
       <nested:equal value="-2" property="endCustomerId">
           <td width="21%" class="NArialL">Add New <bean:message key="label.sales.endUser"/> :</td>
           <td width="21%" class="bodytext"><nested:write property="newEndUserName"  /></td>
       </nested:equal>
       <nested:notEqual value="-2" property="endCustomerId">
           <td width="21%"><font class="NArialL"><bean:message key="label.sales.endUser"/> :</font></td>
           <td width="21%" class="bodytext"><nested:write property="endCustomer"  /></td>
       </nested:notEqual>
       <td width="3%">&nbsp;</td>
        <nested:equal value="-2" property="odmId">
            <td width="21%" class="NArialL">Add New <bean:message key="label.sales.shipToCustomer"/></td>
            <td width="21%" class="bodytext"><nested:write property="newEndCustomerName" /></td>
        </nested:equal>
        <nested:notEqual value="-2" property="odmId">
            <td width="21%"><font class="NArialL"><bean:message key="label.sales.shipToCustomer"/></font></td>
            <td width="21%" class="bodytext"><nested:write property="odm" /></td>
        </nested:notEqual>
       <td width="10%">&nbsp;</td>
     </tr>
    <tr>
       <td width="21%"><font class="NArialL">Pay Terms :</font></td>
       <td width="21%" class="bodytext">
            <nested:notEqual name="salesOrderForm" property="shippingTerms" value="-1" >
                <nested:write name="salesOrderForm" property="shippingTerms"  />
            </nested:notEqual>
       </td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.DeliveryTerms" /> : </font></td>
       <td width="21%" class="bodytext"><nested:write name="salesOrderForm" property="deliveryTerms" />
        </td>
       <td width="10%">&nbsp;</td>

     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Booking Date :</font></td>
       <td width='21%' class="bodytext"><nested:write name="salesOrderForm" property="salesOrderDate"/> </td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL">Quotation No :</font></td>
       <td width="21%" class="bodytext">
            <nested:notEqual value="null" name="salesOrderForm" property="quotationNo">
                <nested:write name="salesOrderForm" property="quotationNo" />
            </nested:notEqual>
       </td>
       <td width="10%">&nbsp;</td>
     </tr>
    <tr>
        <td width="21%"><font class="NArialL">&nbsp;</font></td>
        <td width="21%">&nbsp;</td>
        <td width="3%">&nbsp;</td>
        <nested:equal value="true" name="salesOrderForm" property="isConsignee">
        <td width="25%" class="NArialL">Invoice to Customer : </td>
            <td width="21%" class="bodytext">
                <nested:equal value="0" name="salesOrderForm" property="isConsignmentSales">No</nested:equal>
                <nested:notEqual value="0" name="salesOrderForm" property="isConsignmentSales">Yes</nested:notEqual>
            </td>
        </nested:equal>
        <nested:notEqual value="true" name="salesOrderForm" property="isConsignee">
            <td width="25%">&nbsp;</td>
            <td width="21%">&nbsp;</td>
        </nested:notEqual>
        <td width="3%">&nbsp;</td>
    </tr>
     <tr>
       <td width="21%" valign="top"><font class="NArialL">Billing Address :</font></td>
       <td width="21%" valign="top"><font class="bodytext">
        <!-- < nested:write property="billingAddress"/></font> -->
        <% ApproverOrderForm approveOrderForm = (ApproverOrderForm) request.getAttribute("approverOrderForm"); %>
        <%=approveOrderForm.getSalesOrder().getBillingAddressAsHTML()%>
        </td>
       <td width="3%">&nbsp;</td>
       <td width="21%" valign="top"><font class="NArialL">Shipping Address :</font></td>
       <td width="21%" valign="top"><font class="bodytext">
            <!-- < nested:write property="shippingAddress" /></font> -->
            <%=approveOrderForm.getSalesOrder().getShippingAddressAsHTML()%>
       </td>
       <td width="10%">&nbsp;</td>

     </tr>
     <tr><td colsapn=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
     <tr>
       <td width="21%"><font class="NArialL">Freight Instructions :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="freightInstructions" /></font></td>
       <td width="3%">&nbsp;</td>
       <td width="21%"><font class="NArialL">Shipping Instructions :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="shippingInstructions" /></font></td>
       <td width="10%">&nbsp;</td>

     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Comments :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="comments" /></font></td>
       <td width="3%">&nbsp;</td>
       <td width="21%">&nbsp;</td>
       <td width="21%">&nbsp;</td>
       <td width="10%">&nbsp;</td>

     </tr>
     <!-- Added by Sarada on 18th Feb 2004 to do table alignment -->
      <tr>
       <td width="21%"></td>
       <td width="21%"></td>
       <td width="3%">&nbsp;</td>
       <td width="21%"></td>
       <td width="21%"></td>
       <td width="10%">&nbsp;</td>
     </tr>
     </nested:nest>
     <tr><td colspan=6><chiptrack:info styleClass="NArialL" /></td></tr>
     <tr><td colspan=6><chiptrack:errors styleClass="NArialL" /></td></tr>
     <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
	 <tr><td colspan='6' align="left" class='NArialL'><FONT id="errors" color='FF0000'></FONT><br></TD></tr>

     <tr><td colspan=6>
        <table border="0" width="100%" bordercolor="#FFFFFF">
	 <tr>
	   <td width="7%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Line Item</font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
		   <!-- Modified by veeru on (03/05/04)
           <font color="#FFFFFF">Mfg Part Number</font> -->
           <font color="#FFFFFF"><bean:message key="label.mfgPartNumber" />		</font>
	   </td>
       <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
            <font color="#FFFFFF">
                <!-- Modified by veeru on (03/08/04)
                Customer PartNo                         -->
                <bean:message key="label.customerPartNumber"/>
            </font></td>
       <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
        <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
            <font color="#FFFFFF"><bean:message key="label.labelNumber"/>
		    </font></td>
        <%}%>
       <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
            <font color="#FFFFFF">Description</font></td>
       <td width='1%' align=center bgcolor='#993333' class='NArialL'>
            <font color='#FFFFFF'>Taxable</td>
	   <td width="5%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Quantity</font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Price </font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Amount</font></td>
           <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Req'd Dock Date</font></td>
          <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Sugg ShipDate</font></td>
           <td width="7%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Schedule Date</font></td>
           <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Revised Ship Date</font></td>
           <td width="20%" bgcolor='#993333'>
            <table with="100%" border=0>
                <tr><td colspan=4 class="NArialL" align=center><font color="#FFFFFF">Holds</td></tr>
                <font size="-3"><tR><td width="25%" align=left class="NArialL"><font color="#FFFFFF">Mktg</font></td><td  width="25%" align=center class="NArialL"><font color="#FFFFFF">Fin</font></td><td width="25%" align=right class="NArialL"><font color="#FFFFFF">Ops</FONT></td><td  align=right width="25%" class="NArialL"><font color="#FFFFFF">&nbsp;&nbsp;&nbsp;Sales</FONT></td></tr></font>
            </table>
           </td>
         </tr>
                <% int index=0; %>
<%-- Added by Prabhanjan on 07 Mar 2004. To display Line Items with SubTotals --%>
<logic:iterate id="myHashMap" name="lineItemsWithSubtotals">
    <logic:iterate id="lineItemList" name="myHashMap" >
          <logic:iterate id="LineItem" name="lineItemList" property="key" type="com.scalar.chiptrack.sales.LineItem">
<%-- Till here Prabhanjan --%>

        <%-- <logic:iterate id="LineItem" name="presentLineItems"> --%>

         <tr>
            <td width="7%" bgcolor="#DEE1E2">
            <font class="bodytext"><bean:write name="LineItem" property="lineItemNo" /></font></td>
            <html:hidden name="LineItem" property="lineItemId" />
            <td width="10%" bgcolor="#DEE1E2">
            <font class="bodytext"><bean:write name="LineItem" property="manufacturingPartNo" /></font></td>
            <td width="10%" bgcolor="#DEE1E2">
            <font class="bodytext"><bean:write name="LineItem" property="customerPartNo" /></font></td>
            <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
           <td width="8%" bgcolor="#DEE1E2" nowrap>
                <font class="bodytext"><bean:write name="LineItem" property="labelNumber" /></font></td>
           <%}%>
            <td width="10%" bgcolor="#DEE1E2">
            <font class="bodytext"><bean:write name="LineItem" property="lineItemDescription" /></font></td>
            <td width="1%" bgcolor="#DEE1E2" class="bodytext" align=center>
            <bean:write name="LineItem" property="isTaxableAsString"/></td>
            <td width="5%" bgcolor="#DEE1E2" align=right>
            <font class="bodytext"><bean:write name="LineItem" property="qtyAsString" /></font></td>
            <td width="10%" bgcolor="#DEE1E2" align=right>
            <font class="bodytext"><bean:write name="LineItem" property="unitPriceAsString" /></font></td>
            <td width="10%" bgcolor="#DEE1E2" align=right>
            <font class="bodytext"><bean:write name="LineItem" property="amountAsString" /></font></td>
            <td width="10%" bgcolor="#DEE1E2">
            <font class="bodytext"><bean:write name="LineItem" property="requestDate" /></font></td>
            <td width="8%" bgcolor="#DEE1E2">

                <font class="bodytext"><bean:write name="LineItem" property="suggScheduleDateWithoutSubstitutables"/></font></td>

                <!--<font class="bodytext">< bean:write name="LineItem" property="suggScheduleDate" /></font></td>-->

           <td width="7%" bgcolor="#DEE1E2">
                <font class="bodytext"><bean:write name="LineItem" property="scheduleDate" /></font></td>
           <td width="10%" bgcolor="#DEE1E2" nowrap>
                <logic:notEqual name="LineItem" property="status" value="SHIPPED">
                    <font class="bodytext">
                    <html:text name="LineItem" property="revisedDate" size='12' styleClass='txfield' onkeypress="return noenter()" />
                     <!-- Added by veeru on (29th March 2004)  -->
                     <a href="javascript:if(document.approverOrderForm.revisedDate.length!=null){openScheduleCalendar(document.approverOrderForm.revisedDate[<%=index%>],'<bean:write name="LineItem" property="requestDate" />')}else{openScheduleCalendar(document.approverOrderForm.revisedDate,'<bean:write name="LineItem" property="requestDate" />')}"><img onMouseOver="window.status='Click here to select date';return true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>
                    </font>
           </td>
                </logic:notEqual>
                <logic:equal name="LineItem" property="status" value="SHIPPED">
                    <font class="bodytext"><bean:write name="LineItem" property="status" /></font></td>
                </logic:equal>
             <td width="20%" bgcolor="#DEE1E2">
                <table with="100%">
                <tr>
                    <td class="NArialL">
                        <html:select name="LineItem" property="marketingHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="marketingReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                    <td class="NArialL">
                        <html:select name="LineItem" property="financeHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="financeReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                    <td class="NArialL">
                        <html:select name="LineItem" property="operationsHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="opsReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                    <td class="NArialL">
                        <html:select name="LineItem" property="salesHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="salesReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                </tr>
            </table>
           </td>
        </tr>
        <% index++;%>
       </logic:iterate>

<%-- Added by Prabhajan on 07 Mar 2004 to display subtotals--%>
        <tr>
            <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
            <td colspan="6" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                Sub Total
            </td>
            <%}else{%>
            <td colspan="5" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                Sub Total
            </td>
            <%}%>
            <%-- Modified by Prabhanjan (3 Arp 2004) --%>
            <bean:define id="subTotal" name="lineItemList" property="value" type="com.scalar.chiptrack.sales.SubTotal"/>
            <td colspan="1" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                <bean:write name="subTotal" property="subTotalQty" />
            </td>
            <td>&nbsp;</td>
            <td colspan="1" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                <bean:write name="subTotal" property="subTotalAmt" />
            </td>
        </tr>
   </logic:iterate>
</logic:iterate>

        <tr><td colspan=10>&nbsp;</td></tr>
<%-- End of addition by Prabhanjan on 07 Mar 2004 --%>
    <%--
    <tr>
            <td colspan=4 class="NArialL" align="center"></td>
            <td bgcolor="#DEE1E2" class="NArialL" align="right">< bean:write name="approverOrderForm" property="totalQty" /></td>
         <nested:nest property="salesOrder">
            <td class="NArialL" align="right">Sub Total</td>
            <td bgcolor="#DEE1E2" class="NArialL" align="right">< nested:write property="subTotalAsString" /></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL">Sales Tax</td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right">< nested:write property="salesTaxAsString" /></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL">Freight</td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right">< nested:write property="frieghtAsString" /></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL">< nested:write name="salesOrderForm" property="miscName"/></td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right">< nested:write property="miscAsString" /></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL">Order Total</td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right">< nested:write property="orderTotalAsString" /></td>
        </tr>
        </nested:nest>
        </table>
     </td>
     </tr>
     --%>

     <!-- Layout modified -->
     <tr>
            <td colspan=4 class="NArialL" align="center"></td>
            <td class="NArialL" align="right"></td>
            <td class="NArialL" align="right"></td>
            <td class="NArialL" align="right"></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL"></td>
            <td class="NArialL" align="right"></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL"></td>
            <td class="NArialL" align="right"></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL"></td>
            <td class="NArialL" align="right"></td>
        </tr>
        <tr>
            <td colspan=6 align=right class="NArialL"></td>
            <td class="NArialL" align="right"></td>
        </tr>
        </table>
     </td>
     </tr>
     <!-- Layout modified -->

     <tr>
       <td colspan=6 align=center>
       <% if((request.getParameter("isSample") != null) && (request.getParameter("isSample").equals("0"))) { %>
            <chiptrack:restrictedLink functionality='<%=Functionality.SAMPLE_MISSED_ORDER%>' action='<%=User.USER_ACTION_MODIFY%>' href="javascript:submitPage('SUBMIT');" onmouseover="window.status='Click to Reschedule Sales Order';return true" onmouseout="window.status='';return true">
            <img src="<%=chipTracContext%>/jsp/includes/images/submit.gif" border='0'title="Click here to Reschedule Sales Order"></chiptrack:restrictedLink>
        <% } else { %>
            <chiptrack:restrictedLink functionality='<%=Functionality.SALES_MISSED_ORDER%>' action='<%=User.USER_ACTION_MODIFY%>' href="javascript:submitPage('SUBMIT');" onmouseover="window.status='Click to Reschedule Sales Order';return true" onmouseout="window.status='';return true">
            <img src="<%=chipTracContext%>/jsp/includes/images/submit.gif" border='0' title="Click here to Reschedule Sales Order"></chiptrack:restrictedLink>
        <% } %>
        <%--<chiptrack:restrictedLink functionality='<%=Functionality.SALES_MISSED_ORDER%>' action='<%=User.USER_ACTION_MODIFY%>' href="javascript:submitPage('SUBMIT');" onmouseover="window.status='Click to Reschedule Sales Order';return true" onmouseout="window.status='';return true">
        <img src="<%=chipTracContext%>/jsp/includes/images/submit.gif" border='0' title="Click here to Reschedule Sales Order"></chiptrack:restrictedLink>--%>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="javascript:document.approverOrderForm.reset();" onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true"title="Click here to Reset"><img src="<%=chipTracContext%>/jsp/includes/images/reset.gif" border=0></a>
        <br>
       </td>
     </tr>

    </table>


<input type="hidden" name="action" value="">
<html:hidden name="approverOrderForm" property="salesOrderId" />
<html:hidden name="approverOrderForm" property="salesOrderNo" />
<input type="hidden" name="isSample" value="<%=request.getParameter("isSample")%>">
<input type="hidden" name="salesorderIDFresh" value='<bean:write name="approverOrderForm" property="salesOrderId"/>'>
</html:form>
</html:html>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->

</BODY>
</HTML>